package ch.sfug.util.display {
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.DisplayObject;	

	/**
	 * @author marcel
	 */
	public class DisplayToBitmap {
		
		public static function draw(display:DisplayObject, 
									transparent:Boolean = true, 
									fillColor:uint = 0x00FFFFFF, 
									smoothing:Boolean = true,
									pixelSnapping:String = "auto" ):Bitmap
		{
			var bitmapData:BitmapData = new BitmapData(display.width, display.height, transparent, fillColor);
			bitmapData.draw(display);
			
			return new Bitmap(bitmapData, pixelSnapping, smoothing);	
		}

	}
}